﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Liquid;
using Liquid.Components;
using System.Windows.Media.Imaging;
using Zeus.Classes.Documents;
using Zeus.Events;

namespace Zeus.UserControls
{
    public partial class TabUserControl : UserControl
    {
        TabItem _item;
        public TabUserControl()
        {
            InitializeComponent();
            
        }

        private void AddNewTab(Document doc)
        {
            MessageBox.Show(doc.Doc_ID.ToString());
        }
        private void Sbutton_Click(object sender, RoutedEventArgs e)
        {
            AddTextTab();
        }

        private void AddTextTab()
        {
            _item = new TabItem();
            RichTextBox textbox = new RichTextBox();
            _item.IsSelected = true;

            _item.Header =
         
            _item.Content = textbox;
            
            tab1.Items.Add(_item);
        }
        
        private void IButtonClick(object sender, RoutedEventArgs e)
        {
            AddImageTab();
        }

        private void AddImageTab()
        {
            _item = new TabItem();
            _item.IsSelected = true;
            Image myImage = new Image();
            myImage.Source = new BitmapImage(new Uri("007361990.jpg", UriKind.RelativeOrAbsolute));
            _item.Header = "image editor";
            _item.Content = myImage;
            tab1.Items.Add(_item);
        }

        private void VbuttonClick(object sender, RoutedEventArgs e)
        {
            AddVideoTab();
        }

        private void AddVideoTab()
        {
            _item = new TabItem();
            _item.IsSelected = true;
            MediaElement mymedia = new MediaElement();
            mymedia.Source = new Uri("خليك فاكرني.WMV", UriKind.Relative);
            mymedia.Play();
            _item.Header = "video editor";
            mymedia.AutoPlay = true;
            _item.Content = mymedia;
            tab1.Items.Add(_item);
        }

        private void SoundbuttonClick(object sender, RoutedEventArgs e)
        {
            AddSoundTab();  
        }

        private void AddSoundTab()
        {
            _item = new TabItem();
            _item.IsSelected = true;
            MediaElement mymedia = new MediaElement();
            mymedia.Source = new Uri("Unutma_Beni.mp3", UriKind.Relative);
            _item.Header = "sound editor";
            mymedia.AutoPlay = true;
            _item.Content = mymedia;
            tab1.Items.Add(_item);
        }
    }
}
